<template>
  <el-card>
    <div class="page-tools">
      <div class="left">
        <!-- 需求: 如果你不传左侧的结构, 那么这个盒子.tips就别显示了; 传了就要显示; -->
        <div v-if="$slots.left" class="tips">
          <i class="el-icon-info" />
          <!-- <span>总记录数 18条</span> -->
          <!-- 不能写死 -->
          <slot name="left" />
        </div>
      </div>

      <div class="right">
        <!-- <el-button type="warning" size="small">excel导入</el-button>
        <el-button type="danger" size="small">excel导出</el-button>
        <el-button type="primary" size="small">新增员工</el-button> -->
        <slot name="right" />
      </div>
    </div>
  </el-card>
</template>

<script>
export default {
  // $slots 获取当前组件的拿到的所有结构
  created() {
    console.log(this.$slots)
  }
}
</script>

<style lang="scss" scoped>
.page-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;

  .tips {
    line-height: 34px;
    padding: 0px 15px;
    border-radius: 5px;
    border: 1px solid rgba(145, 213, 255, 1);
    background: rgba(230, 247, 255, 1);
    // font-size: 12px;
    i {
      margin-right: 10px;
      color: #409eff;
    }
  }
}

</style>
